<!DOCTYPE html>

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>class RubyXL::Reference - rubyXL 3.4.35</title>


  <meta name="keywords" content="ruby,class,RubyXL::Reference">


    <meta name="description" content="Documentation for the RubyXL::Reference class">





<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
</script>

<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">



<body id="top" role="document" class="class">
<div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
  <span aria-hidden="true">&#9776;</span>
</div>


<nav id="navigation" role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  

  
<div id="parent-class-section" class="nav-section">
  <h3>Ancestors</h3>
  <ul><li>Object</li></ul>
</div>


  

  

  
  <div class="nav-section">
    <h3>Class Methods</h3>
    <ul class="link-list" role="directory">

      <li ><a href="#method-c-ind2ref">ind2ref</a></li>

      <li ><a href="#method-c-new">new</a></li>

      <li ><a href="#method-c-ref2ind">ref2ind</a></li>

    </ul>
  </div>



  <div class="nav-section">
    <h3>Instance Methods</h3>
    <ul class="link-list" role="directory">

      <li ><a href="#method-i-3D-3D">==</a></li>

      <li ><a href="#method-i-cover-3F">cover?</a></li>

      <li ><a href="#method-i-first_col">first_col</a></li>

      <li ><a href="#method-i-first_row">first_row</a></li>

      <li ><a href="#method-i-inspect">inspect</a></li>

      <li ><a href="#method-i-last_col">last_col</a></li>

      <li ><a href="#method-i-last_row">last_row</a></li>

      <li ><a href="#method-i-single_cell-3F">single_cell?</a></li>

      <li ><a href="#method-i-to_s">to_s</a></li>

      <li ><a href="#method-i-valid-3F">valid?</a></li>

    </ul>
  </div>



  <footer id="validator-badges" role="contentinfo">
  <p><a href="https://validator.w3.org/check/referer">Validate</a></p>
  <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.15.1.</p>
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>
</footer>

</nav>

<main role="main" aria-labelledby="class-RubyXL::Reference">
  
  
    <ol role="navigation" aria-label="Breadcrumb navigation" class="breadcrumb">
      
      <li>
        
        <a href="../RubyXL.html">RubyXL</a><span>::</span>
        
      </li>
      
      <li>
        
        <span>Reference</span>
        
      </li>
      
    </ol>
  

  <h1 id="class-RubyXL::Reference" class="anchor-link class">
    class RubyXL::Reference
  </h1>

  <section class="description">
    
  </section>


  <section id="5Buntitled-5D" class="documentation-section anchor-link">





    <section class="constants-list">
      <header>
        <h3>Constants</h3>
      </header>
      <dl>

        <dt id="COL_MAX">COL_MAX</dt>

        <dd>

          
        </dd>


        <dt id="ROW_MAX">ROW_MAX</dt>

        <dd>

          
        </dd>


      </dl>
    </section>



    <section class="attribute-method-details method-section">
      <header>
        <h3>Attributes</h3>
      </header>


      <div id="attribute-i-col_range" class="method-detail anchor-link">
        <div class="method-heading attribute-method-heading">
          <a href="#attribute-i-col_range" title="Link to this attribute">
            <span class="method-name">col_range</span>
            <span class="attribute-access-type">[R]</span>
          </a>
        </div>

        <div class="method-description">


        

        </div>
      </div>

      <div id="attribute-i-row_range" class="method-detail anchor-link">
        <div class="method-heading attribute-method-heading">
          <a href="#attribute-i-row_range" title="Link to this attribute">
            <span class="method-name">row_range</span>
            <span class="attribute-access-type">[R]</span>
          </a>
        </div>

        <div class="method-description">


        

        </div>
      </div>

    </section>



     <section id="public-class-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Public Class Methods</h3>
       </header>


      <div id="method-c-ind2ref" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-c-ind2ref" title="Link to this method">
                <span class="method-name">ind2ref</span>
                <span class="method-args">(row = 0, col = 0)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="ind2ref-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 89</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">ind2ref</span>(<span class="ruby-identifier">row</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">col</span> = <span class="ruby-value">0</span>)
  <span class="ruby-identifier">str</span> = <span class="ruby-string">&#39;&#39;</span>

  <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">x</span> = <span class="ruby-identifier">col</span> <span class="ruby-operator">%</span> <span class="ruby-value">26</span>
    <span class="ruby-identifier">str</span> = (<span class="ruby-string">&#39;A&#39;</span>.<span class="ruby-identifier">ord</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">x</span>).<span class="ruby-identifier">chr</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">str</span>
    <span class="ruby-identifier">col</span> = (<span class="ruby-identifier">col</span> <span class="ruby-operator">/</span> <span class="ruby-value">26</span>).<span class="ruby-identifier">floor</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">break</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">col</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">0</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">str</span> <span class="ruby-operator">+=</span> (<span class="ruby-identifier">row</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          <p>Converts <code>row</code> and <code>col</code> zero-based indices to Excel-style cell reference &lt;0&gt; A…Z, AA…AZ, BA… …ZZ, AAA… …AZZ, BAA… …XFD &lt;16383&gt;</p>


        </div>





      </div>


      <div id="method-c-new" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-c-new" title="Link to this method">
                <span class="method-name">new</span>
                <span class="method-args">(*params)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">params</span>)
  <span class="ruby-identifier">row_from</span> = <span class="ruby-identifier">row_to</span> = <span class="ruby-identifier">col_from</span> = <span class="ruby-identifier">col_to</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">size</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">4</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-identifier">params</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">2</span> <span class="ruby-keyword">then</span> <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span> = <span class="ruby-identifier">params</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">1</span> <span class="ruby-keyword">then</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">params</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_from</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-identifier">params</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">fetch_values</span>(<span class="ruby-value">:row_from</span>, <span class="ruby-value">:row_to</span>, <span class="ruby-value">:col_from</span>, <span class="ruby-value">:col_to</span>)
    <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span> <span class="ruby-keyword">then</span>
      <span class="ruby-identifier">from</span>, <span class="ruby-identifier">to</span> = <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39;:&#39;</span>)
      <span class="ruby-identifier">row_from</span>, <span class="ruby-identifier">col_from</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">from</span>)
      <span class="ruby-identifier">row_to</span>, <span class="ruby-identifier">col_to</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-identifier">to</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">to</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;invalid value for #{self.class}: #{params[0].inspect}&quot;</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">String</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@row_range</span> = <span class="ruby-constant">Range</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">row_from</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">row_to</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">row_from</span> <span class="ruby-operator">||</span> <span class="ruby-constant">ROW_MAX</span>)
  <span class="ruby-ivar">@col_range</span> = <span class="ruby-constant">Range</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">col_from</span> <span class="ruby-operator">||</span> <span class="ruby-value">0</span>, <span class="ruby-identifier">col_to</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">col_from</span> <span class="ruby-operator">||</span> <span class="ruby-constant">COL_MAX</span>)
<span class="ruby-keyword">end</span></pre>
          </div>



          <p><a href="Reference.html#method-c-new"><code>RubyXL::Reference.new(row, col)</code></a> <a href="Reference.html#method-c-new"><code>RubyXL::Reference.new(row_from, row_to, col_from, col_to)</code></a> <a href="Reference.html#method-c-new"><code>RubyXL::Reference.new(reference_string)</code></a> <a href="Reference.html#method-c-new"><code>RubyXL::Reference.new</code></a>(row_from:, row_to:, col_from:, col_to:)</p>


        </div>





      </div>


      <div id="method-c-ref2ind" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-c-ref2ind" title="Link to this method">
                <span class="method-name">ref2ind</span>
                <span class="method-args">(str)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="ref2ind-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 103</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">ref2ind</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-keyword">return</span> [ <span class="ruby-value">-1</span>, <span class="ruby-value">-1</span> ] <span class="ruby-keyword">unless</span> <span class="ruby-identifier">str</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A([A-Z]+)(\d+)\Z/</span>
  [ <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">2</span>).<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>,
    <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>(<span class="ruby-value">1</span>).<span class="ruby-identifier">each_byte</span>.<span class="ruby-identifier">inject</span>(<span class="ruby-value">0</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">col</span>, <span class="ruby-identifier">chr</span><span class="ruby-operator">|</span> (<span class="ruby-identifier">col</span> <span class="ruby-operator">*</span> <span class="ruby-value">26</span>) <span class="ruby-operator">+</span> (<span class="ruby-identifier">chr</span> <span class="ruby-operator">-</span> <span class="ruby-value">64</span>) } <span class="ruby-operator">-</span> <span class="ruby-value">1</span> ]
<span class="ruby-keyword">end</span></pre>
          </div>



          <p>Converts Excel-style cell reference to <code>row</code> and <code>col</code> zero-based indices.</p>


        </div>





      </div>


    </section>

     <section id="public-instance-5Buntitled-5D-method-details" class="method-section anchor-link">
       <header>
         <h3>Public Instance Methods</h3>
       </header>


      <div id="method-i-3D-3D" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-3D-3D" title="Link to this method">
                <span class="method-name">==</span>
                <span class="method-args">(other)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="3D-3D-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 59</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">==</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-operator">!</span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@row_range</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@col_range</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>)
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-cover-3F" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-cover-3F" title="Link to this method">
                <span class="method-name">cover?</span>
                <span class="method-args">(other)</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="cover-3F-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 63</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cover?</span>(<span class="ruby-identifier">other</span>)
  <span class="ruby-operator">!</span><span class="ruby-identifier">other</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">&amp;&amp;</span>
                  <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">end</span>) <span class="ruby-operator">&amp;&amp;</span>
                  <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">&amp;&amp;</span>
                  <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">cover?</span>(<span class="ruby-identifier">other</span>.<span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">end</span>))
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-first_col" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-first_col" title="Link to this method">
                <span class="method-name">first_col</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="first_col-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 51</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">first_col</span>
  <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-first_row" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-first_row" title="Link to this method">
                <span class="method-name">first_row</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="first_row-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 43</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">first_row</span>
  <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-inspect" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-inspect" title="Link to this method">
                <span class="method-name">inspect</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 79</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">single_cell?</span> <span class="ruby-keyword">then</span>
    <span class="ruby-node">&quot;#&lt;#{self.class} @row=#{@row_range.begin} @col=#{@col_range.begin}&gt;&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-node">&quot;#&lt;#{self.class} @row_range=#{@row_range} @col_range=#{@col_range}&gt;&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-last_col" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-last_col" title="Link to this method">
                <span class="method-name">last_col</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="last_col-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 55</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">last_col</span>
  <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-last_row" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-last_row" title="Link to this method">
                <span class="method-name">last_row</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="last_row-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 47</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">last_row</span>
  <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-single_cell-3F" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-single_cell-3F" title="Link to this method">
                <span class="method-name">single_cell?</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="single_cell-3F-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 35</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">single_cell?</span>
  (<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>) <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>)
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-to_s" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-to_s" title="Link to this method">
                <span class="method-name">to_s</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="to_s-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 70</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_s</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">single_cell?</span> <span class="ruby-keyword">then</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">begin</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">begin</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&#39;:&#39;</span> <span class="ruby-operator">+</span>
                       <span class="ruby-keyword">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-ivar">@row_range</span>.<span class="ruby-identifier">end</span>, <span class="ruby-ivar">@col_range</span>.<span class="ruby-identifier">end</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


      <div id="method-i-valid-3F" class="method-detail anchor-link ">
        <div class="method-header">

            <div class="method-heading">
              <a href="#method-i-valid-3F" title="Link to this method">
                <span class="method-name">valid?</span>
                <span class="method-args">()</span>
              </a>
            </div>

        </div>


          <div class="method-controls">
            <details class="method-source-toggle">
              <summary>Source</summary>
            </details>
          </div>



        <div class="method-description">

          <div class="method-source-code" id="valid-3F-source">
            <pre><span class="ruby-comment"># File lib/rubyXL/objects/reference.rb, line 39</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">valid?</span>
  <span class="ruby-operator">!</span>(<span class="ruby-identifier">row_range</span>.<span class="ruby-identifier">begin</span>.<span class="ruby-identifier">negative?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">col_range</span>.<span class="ruby-identifier">begin</span>.<span class="ruby-identifier">negative?</span>)
<span class="ruby-keyword">end</span></pre>
          </div>



          


        </div>





      </div>


    </section>

  </section>

</main>
</body>

